package com.syt.service.service;

import com.syt.service.dao.PhoneBaseMapper;
import com.syt.service.dao.PhoneBatteryMapper;
import com.syt.service.dao.PhoneShowMapper;
import com.syt.service.pojo.PhoneBattery;
import com.syt.service.pojo.PhoneShow;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author ：syt
 * @date ：Created in 2019-10-02 13:56
 * @description：电池续航信息
 */
@Service
public class PhoneBatteryService {

    @Autowired(required = false)
    PhoneBatteryMapper mapper;

    /**
     * 删除电池续航 根据id
     * @param id
     * @return
     */
    public int deleteById(Integer id) {
        return mapper.deleteByPrimaryKey(id);
    }

    /**
     * 完全插入 电池续航 数据
     * @param battery
     * @return
     */
    public int insert(PhoneBattery battery) {
        return mapper.insert(battery);
    }

    /**
     * 选择插入 电池续航 数据
     * @param battery
     * @return
     */
    public int insertBySelective(PhoneBattery battery) {
        return mapper.insertSelective(battery);
    }

    /**
     * 根据id查询 电池续航 数据
     * @param id
     * @return
     */
    public PhoneBattery getById(Integer id) {
        return mapper.selectByPrimaryKey(id);
    }

    /**
     * 选择性更新 电池续航 数据
     * @param battery
     * @return
     */
    public int updateBySelective(PhoneBattery battery) {
        return mapper.updateByPrimaryKeySelective(battery);
    }

    /**
     * 完全更新 电池续航数据
     * @param battery
     * @return
     */
    public int update(PhoneBattery battery) {
        return mapper.updateByPrimaryKey(battery);
    }


}
